package com.atguigu.order.config;

import feign.Logger;
import feign.RetryableException;
import feign.Retryer;
import org.reactivestreams.Publisher;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import reactor.core.publisher.Flux;
import reactor.util.retry.Retry;

/**
 * @author fhs
 * Create by 2025/6/23 10:29
 */
@Configuration
public class OrderConfig {

    //给他放一个RestTemplate 这样就不用new了，直接从容器中获取
    @LoadBalanced
    @Bean
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

    //日志水平
    @Bean
    Logger.Level feignLoggerLevel(){
        return Logger.Level.FULL;
    }
    //重载调用
    @Bean
    Retryer retryer() {
        return new Retryer.Default();
    }
}
